package userInterface;

import java.awt.Color;

public class Ellipse extends DrawObject
{
	public Ellipse(Point topLeft, int width, int height, int thickness, Color color)
	{
		super(color);
		super.setShape(Shape.ELLIPSE);
		_topLeft = topLeft;
		_width = width;
		_height = height;
		_thickness = thickness;
	}
	
	public Ellipse(Ellipse e)
	{
		super(e.getColor());
		super.setShape(Shape.ELLIPSE);
		_topLeft = new Point(e.getTopLeft().X, e.getTopLeft().Y);
		_width = e.getWidth();
		_height = e.getHeight();
		_thickness = e.getThickness();
	}

	public int getThickness()
	{
		return _thickness;
	}
	
	public void setThickness(int thickness)
	{
		_thickness = thickness;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	public Point getTopLeft()
	{
		return _topLeft;
	}
	
	public void setTopLeft(Point topLeft)
	{
		_topLeft = topLeft;
		for (DrawingModel m : _models)
			m.modelChanged();
	}
	
	public int getWidth()
	{
		return _width;
	}
	
	public void setWidth(int width)
	{
		//if (width < 10)
		//	return;
		
		_width = width;
		for (DrawingModel m : _models)
			m.modelChanged();

	}
	
	public int getHeight()
	{
		return _height;
	}
	
	public void setHeight(int height)
	{
		//if (height < 10)
		//	return;
		
		_height = height;
		for (DrawingModel m : _models)
			m.modelChanged();

	}
	
	@Override
	public void move(int x, int y)
	{
		_topLeft = new Point(_topLeft.X + x, _topLeft.Y + y);
		for (DrawingModel m : _models)
			m.modelChanged();

	}
	
	private Point _topLeft;
	
	private int _width;
	
	private int _height;
	
	private int _thickness;
}
